/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 - 2008 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/

package com.genia.toolbox.web.gwt.form.client.bean;

import com.google.gwt.user.client.Command;

/**
 * an object that must be inited before actions can be done, but that will use
 * asynchronism for initialisation.
 */
public interface ExecutionDelayable
{

  /**
   * returns whether the object is initialized.
   * 
   * @return whether the object is initialized
   */
  public abstract boolean isInitialized();



  /**
   * add a {@link ExecutionDelayableListener} that will be signaled when the
   * status of the object change.
   * 
   * @param executionDelayableListener
   *          the {@link ExecutionDelayableListener} to add
   */
  public abstract void addExecutionDelayableListener(ExecutionDelayableListener executionDelayableListener);



  /**
   * register a {@link Command} to execute when the object is initialized.
   * 
   * @param command
   *          the command to execute when the object is initialized
   */
  public abstract void execute(Command command);

}
